﻿#include <QCoreApplication>

#include "subcomponent.h"
#include "adminoffice.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    AbstractComponent* head = new SubComponent("header");

    AbstractComponent* office1 = new AdminOffice("office1");
    head->add(office1);

    AbstractComponent* subHead1 = new SubComponent("subhead1");
    head->add(subHead1);

    AbstractComponent* subHead2 = new SubComponent("subhead2");
    head->add(subHead2);

    AbstractComponent* subHead21 = new SubComponent("subhead21");
    subHead2->add(subHead21);

    AbstractComponent* subHead22 = new SubComponent("subhead22");
    subHead2->add(subHead22);

    head->operation();

    delete subHead2;
    delete subHead1;
    delete office1;
    delete head;

    return a.exec();
}
